<template>
  <div>
    <DemoWrapper>
      <div class="title">Demo</div>
      <div class="info">
        <a-form-model>
          <a-form-model-item label="当前token：">
            {{token}}
          </a-form-model-item>
          <a-form-model-item label="跳转登录">
            <a-button @click="handleLogin">去登录</a-button>
            <div class="tip">不带logout标识，若登录中心token未过期会自动登录回跳</div>
          </a-form-model-item>
          <a-form-model-item label="退出登录">
            <a-button @click="handleLogout">退出登录</a-button>
            <div class="tip">携带logout标识</div>
          </a-form-model-item>
        </a-form-model>
      </div>
    </DemoWrapper>
  </div>
</template>

<script>
import { DemoWrapper } from './style'
import { mapGetters } from 'vuex'
import produce from 'immer'

export default {
  name: 'app-list',
  components: {
    DemoWrapper,
  },
  computed: {
    ...mapGetters(['auth', 'token']),
  },
  data () {
    return {
    }
  },
  mounted () {
  },
  methods: {
    handleLogin () {
      this.$store.dispatch('logout', false)
    },
    handleLogout () {
      this.$store.dispatch('logout', true)
    },
  },
}
</script>
